-
Notifications
You must be signed in to change notification settings - Fork 160
feat: add PDF export feature to Grid components #16324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
…gniteUI/igniteui-angular into copilot/add-pdf-export-feature
| @@ -318,6 +319,7 @@ export const GridResourceStringsEN: IGridResourceStrings = { | |||
| igx_grid_toolbar_exporter_button_label: 'Export', | |||
| igx_grid_toolbar_exporter_excel_entry_text: 'Export to Excel', | |||
| igx_grid_toolbar_exporter_csv_entry_text: 'Export to CSV', | |||
| igx_grid_toolbar_exporter_pdf_entry_text: 'Export to PDF', | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Add translations for this resource string to all supported language resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added translations for igx_grid_toolbar_exporter_pdf_entry_text to all 19 supported language resource files (BG, CS, DA, DE, ES, FR, HU, IT, JA, KO, NB, NL, PL, PT, RO, SV, TR, ZH-HANS, ZH-HANT). Each translation follows the same pattern as the existing Excel and CSV export strings in that language. Commit: 4c01c0f
Co-authored-by: kdinev <[email protected]>
kdinev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pdf export from IgxHierarchicalGridComponent and IgxTreeGridComponent does not show any hierarchy in the exported visualisation. Export with hierarchical visualisation in pdf, similar to how excel hierarchical visualisations are exported.
|
@copilot Address the latest comment and also update the |
- Added indentation support for TreeGrid and HierarchicalGrid records in PDF export - Records with level property now indent by 15pt per level in first column - Skip hidden records (collapsed hierarchy nodes) from export - Added jspdf to ng-add schematic dependencies map for automatic installation Co-authored-by: kdinev <[email protected]>
Implemented both requested changes:
Commit: 94e7d39 |
|
@copilot Grids are usually wide, so make the default pageOrientation option for grid export to be landscape. |
Grids are typically wide, so landscape orientation is more suitable as the default for grid exports. Co-authored-by: kdinev <[email protected]>
Changed default |
* refactor(exporters): moving exporters under grids/core * test(excel exporter): fixing import paths from /core
* refactor(exporters): moving exporters under grids/core * test(excel exporter): fixing import paths from /core * feat(pdf exporter): making jsPDF a dynamic import * chore(*): fixing incorrect block indentation
projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter-grid.spec.ts
Outdated
Show resolved
Hide resolved
rkaraivanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a side note that there are several key areas for refactoring.
However, this could be achieved after release since we are time-pressed now.
outdated: requests have been long addressed
damyanpetev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor cleanup, otherwise should be fine.
PDF Export Feature Implementation - COMPLETE ✅
Summary
Successfully implemented PDF export functionality for Angular Grid components, addressing the feature request to provide PDF export alongside Excel and CSV export options.
Recent Updates (Latest Commit)
Fixed Pivot Grid Export - Row Dimensions
Implementation Checklist
Key Features Implemented
1. PDF Exporter Service (
IgxPdfExporterService)IgxBaseExporterfollowing the same pattern as Excel/CSV exporters2. PDF Exporter Options (
IgxPdfExporterOptions)pageOrientation: 'portrait' or 'landscape' (default: landscape)pageSize: 'a4', 'a3', 'letter', 'legal', etc. (default: 'a4')showTableBorders: Show/hide table borders (default: true)fontSize: Font size for table content (default: 10)3. Grid Toolbar Integration
IgxGridToolbarExporterComponentIgxPdfTextDirectivefor customizable button textexportPDFinput property to control button visibility (default: true)4. Full Internationalization Support
5. Hierarchy Support
6. Column Groups Support
7. Summary Support
8. Pivot Grid Support
9. ng-add Schematic
ng add igniteui-angular, jspdf will be automatically included10. Interactive Demo Component
src/app/grid-pdf-export/IgxPdfExporterServiceAPI usage11. Comprehensive Test Coverage
12. Documentation
Build Status: ✅ TypeScript compilation successful
Lint Status: ✅ Passed
Code Review: ✅ All feedback addressed
Security: ✅ No vulnerabilities ([email protected] vetted)
i18n: ✅ All 19 languages updated
Schematics: ✅ jspdf added to dependencies map
Demo: ✅ Interactive demo with all grid types (regular, tree, hierarchical, pivot)
Test Coverage: ✅ 35+ comprehensive tests
Documentation: ✅ CHANGELOG.md updated
Ready for merge! 🚀
Original prompt
Fixes #5696
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.